import { createApp, Directive } from "vue";
import "./style.css";
import App from "./App.vue";
import router from "@/router/index";
import piniaPluginPersist from "pinia-plugin-persistedstate";
import { createPinia } from "pinia";
import sizeDirective from "@/directive/sizeDirective";
import "./permission";
import * as directive from "@/directive";
import "./tailwindcss/index.css";
import vue3SeamlessScroll from "vue3-seamless-scroll";

const app = createApp(App);
const pinia = createPinia();
app.use(pinia.use(piniaPluginPersist));
// 你可以自定义这个name名称
app.use(vue3SeamlessScroll, { name: "seamless-scroll" });
app.use(router).mount("#app");
// 注册单个自定义指令
app.directive("size", sizeDirective as Directive);

Object.keys(directive).forEach(key => {
    app.directive(key, (directive as { [key: string]: Directive })[key]);
});
